package com.hopu.dy.controller;


import com.hopu.dy.pojo.LikeNotice;
import com.hopu.dy.service.ILikeNoticeService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/likenotices")
public class LikeNoticeController {
    @Resource
    private ILikeNoticeService ILikeNoticeService;

    // 创建点赞通知（用户点赞视频时调用）
    @PostMapping
    public void createLikeNotice(@RequestParam Long likerId, @RequestParam Long videoId) {
        ILikeNoticeService.createLikeNotice(likerId, videoId);
    }

    // 获取当前用户的所有点赞通知
    @GetMapping
    public List<LikeNotice> getLikeNotices(@RequestParam Long likedUserId) {
        return ILikeNoticeService.getLikeNotices(likedUserId);
    }
}
